package com.xbongbong.util;

import com.alibaba.fastjson.JSONArray;
import com.xbongbong.paas.pojo.SummaryDataPoJo;

import java.util.List;
import java.util.Objects;

/**
 * @author 吴峰
 * @date 2022/02/15 9:35
 */
public class SummaryUtil {


    /**
     * 通过摘要字段获取摘要内容
     *
     * @param summaryList 摘要内容
     * @param attr        字段
     * @return SummaryDataPoJo
     * @author GuoJun.HU
     * @date 2019/4/4 10:49
     * @since V1.0
     */
    public static SummaryDataPoJo getSummaryDataPoJoByAttr(List<SummaryDataPoJo> summaryList, String attr) {
        for (SummaryDataPoJo summaryItem : summaryList) {
            if (Objects.equals(summaryItem.getAttr(), attr)) {
                return summaryItem;
            }
        }
        return null;
    }




}
